local mt = ac.buff['减速']

mt.control = 2
mt.debuff = true
mt.effect = nil
mt.ref = 'origin'
mt.model = [[Abilities\Spells\Human\slow\slowtarget.mdl]]

function mt:on_add()
	local unit = self.owner
	unit:add('移动速度%', - self.move_speed_rate)
	if self.model then
		self.effect = unit:add_effect(self.model,self.ref)
	end
end

function mt:on_remove()
	local unit = self.owner
	unit:add('移动速度%', self.move_speed_rate)
	if self.effect then
		self.effect:remove()
	end
end

function mt:on_cover(new)
	if new.move_speed_rate == self.move_speed_rate then
		self:set_remaining(new.time)
	end
	return new.move_speed_rate > self.move_speed_rate
end
